import { resultSuccess } from '../_util';

const menuList = () => {
  const result: any[] = [
    {
      label: '主页',
      key: 'dashboard',
      type: 1,
      subtitle: 'dashboard',
      openType: 1,
      auth: 'dashboard',
      path: '/dashboard',
      children: [
        {
          label: '主控台',
          key: 'console',
          type: 1,
          subtitle: 'console',
          openType: 1,
          auth: 'console',
          path: '/dashboard/console',
        },
        {
          label: '工作台',
          key: 'workplace',
          type: 1,
          subtitle: 'workplace',
          openType: 1,
          auth: 'workplace',
          path: '/dashboard/workplace',
        },
      ],
    },
    {
      label: '数据',
      key: 'data',
      type: 1,
      subtitle: 'data',
      openType: 1,
      auth: 'data',
      path: '/data',
      children: [
        {
          label: '数据总览',
          key: 'dataOverview',
          type: 1,
          subtitle: 'dataOverview',
          openType: 1,
          auth: 'data_dataOverview',
          path: '/data/dataOverview',
        },
        {
          label: '每日账单',
          key: 'dailyBill',
          type: 1,
          subtitle: 'dailyBill',
          openType: 1,
          auth: 'data_dailyBill',
          path: '/data/dailyBill',
        },
        {
          label: '排行管理',
          key: 'rankManage',
          type: 1,
          subtitle: 'rankManage',
          openType: 1,
          auth: 'data_rankManage',
          path: '/data/rankManage',
        },
      ]
    }, {
      label: '游戏',
      key: 'game',
      type: 1,
      subtitle: 'game',
      openType: 1,
      auth: 'game',
      path: '/game',
      children: [
        {
          label: '游戏管理',
          key: 'gameList',
          type: 1,
          subtitle: 'gameList',
          openType: 1,
          auth: 'game_gameList',
          path: '/game/gameList',
        },
        {
          label: '红包开关管理',
          key: 'redEnvelopeSwitch',
          type: 1,
          subtitle: 'redEnvelopeSwitch',
          openType: 1,
          auth: 'game_redEnvelopeSwitch',
          path: '/game/redEnvelopeSwitch',
        },
      ]
    }, {
      label: '设置',
      key: 'configure',
      type: 1,
      subtitle: 'configure',
      openType: 1,
      auth: 'configure',
      path: '/configure',
      children: [
        {
          label: '账号',
          key: 'configure_account',
          type: 1,
          subtitle: 'configure_account',
          openType: 1,
          auth: 'configure_account',
          path: '/configure/account',
          children: [
            {
              label: '操作记录',
              key: 'operationRecord',
              type: 1,
              subtitle: 'operationRecord',
              openType: 1,
              auth: 'configure_account_operationRecord',
              path: '/configure/account/operationRecord',
            },
            {
              label: '密码修改',
              key: 'modifyPasswd',
              type: 1,
              subtitle: 'modifyPasswd',
              openType: 1,
              auth: 'configure_account_modifyPasswd',
              path: '/configure/account/modifyPasswd',
            },
          ]
        },
        {
          label: '账第三方配置管理号',
          key: 'thirdPartyConfig',
          type: 1,
          subtitle: 'thirdPartyConfig',
          openType: 1,
          auth: 'configure_account_operationRecord',
          path: '/thirdPartyConfig',
          children: [{
            label: '微信移动应用',
            key: 'wechatMobileApplication',
            type: 1,
            subtitle: 'wechatMobileApplication',
            openType: 1,
            auth: 'thirdPartyConfig_wechatMobileApplication',
            path: '/thirdPartyConfig/wechatMobileApplication',
          },
          {
            label: '微信公众号',
            key: 'wechatOfficialAccount',
            type: 1,
            subtitle: 'wechatOfficialAccount',
            openType: 1,
            auth: 'thirdPartyConfig_wechatOfficialAccount',
            path: '/thirdPartyConfig/wechatOfficialAccount',
          },
          {
            label: '微信商户平台',
            key: 'wechatMerchantPlatform',
            type: 1,
            subtitle: 'wechatMerchantPlatform',
            openType: 1,
            auth: 'thirdPartyConfig_wechatMerchantPlatform',
            path: '/thirdPartyConfig/wechatMerchantPlatform',
          },
          {
            label: '支付宝',
            key: 'alipay',
            type: 1,
            subtitle: 'alipay',
            openType: 1,
            auth: 'thirdPartyConfig_alipay',
            path: '/thirdPartyConfig/alipay',
          },
          {
            label: '短信配置',
            key: 'smsConfig',
            type: 1,
            subtitle: 'smsConfig',
            openType: 1,
            auth: 'thirdPartyConfig_smsConfig',
            path: '/thirdPartyConfig/smsConfig',
          },
          ]
        }
      ]
    }, {
      label: '玩家',
      key: 'player',
      type: 1,
      subtitle: 'player',
      openType: 1,
      auth: 'player',
      path: '/player',
      children: [
        {
          label: '玩家管理',
          key: 'playerManage.ts',
          type: 1,
          subtitle: 'playerManage.ts',
          openType: 1,
          auth: 'player_playerManage',
          path: '/player/playerManage.ts',
        },
        {
          label: '玩家角色',
          key: 'playerRole',
          type: 1,
          subtitle: 'playerRole',
          openType: 1,
          auth: 'player_playerRole',
          path: '/player/playerRole',
        },
      ]
    },
    {
      label: '直播',
      key: 'liveBroadcast',
      type: 1,
      subtitle: 'liveBroadcast',
      openType: 1,
      auth: 'liveBroadcast',
      path: '/liveBroadcast',
      children: [
        {
          label: '主播账单',
          key: 'anchorBill',
          type: 1,
          subtitle: 'anchorBill',
          openType: 1,
          auth: 'liveBroadcast_anchorBill',
          path: '/liveBroadcast/anchorBill',
        },
        {
          label: '分包管理',
          key: 'subpackage',
          type: 1,
          subtitle: 'subpackage',
          openType: 1,
          auth: 'liveBroadcast_subpackage',
          path: '/liveBroadcast/subpackage',
        }
      ]
    }
  ];
  return result;
};

const baseList=()=>{
  const result:any[]=
    [
      {
        "psDesc": "基础数据统计分析",
        "psId": 101,
        "psName": "数据",
        "psUrl": "/data"
      },
      {
        "psDesc": "游戏基础配置",
        "psId": 102,
        "psName": "游戏",
        "psUrl": "/game"
      },
      {
        "psDesc": "红包活动",
        "psId": 103,
        "psName": "活动",
        "psUrl": "/activity"
      },
      {
        "psDesc": "游戏玩家",
        "psId": 104,
        "psName": "玩家",
        "psUrl": "/player"
      },
      {
        "psDesc": "游戏直播监控",
        "psId": 105,
        "psName": "直播",
        "psUrl": "/live"
      },
      {
        "psDesc": "系统监控",
        "psId": 106,
        "psName": "监控",
        "psUrl": "/monitor"
      },
      {
        "psDesc": "系统设置",
        "psId": 107,
        "psName": "设置",
        "psUrl": "/setting"
      }
    ]
    return result;
}

export default [
  {
    url: '/api/menu/list',
    timeout: 1000,
    method: 'get',
    response: () => {
      const list = menuList();
      return resultSuccess({
        list,
      });
    },
  },
  {
    url: '/api/menu/base_list',
    timeout: 1000,
    method: 'get',
    response: () => {
      const list = baseList();
      return resultSuccess({
        list,
      });
    },
  },
];
